package com.itcast.netty.spring;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 业务处理类
 *
 * @author zheng.zhang
 */
@Component
public class SpringChildChannelHandler extends ChannelInitializer<SocketChannel> {
    @Autowired
    private SpringDiscardServerHandler serverHandler;

    @Override
    protected void initChannel(SocketChannel socketChannel) {
        socketChannel.pipeline().addLast(serverHandler);
    }
}
